package org.come.bean;

public class PrivateData {
	private String taskComplete;
	private String taskData;
	private String Skills;
	private String born;
	private String TimingGood;

	public PrivateData() {
	}

	public String getTaskComplete() {
		return this.taskComplete;
	}

	public void setTaskComplete(String taskComplete) {
		this.taskComplete = taskComplete;
	}

	public String getTaskData() {
		return this.taskData;
	}

	public void setTaskData(String taskData) {
		this.taskData = taskData;
	}

	public String getSkills() {
		return this.Skills == null ? "" : this.Skills;
	}

	public String[] getSkill(String type) {
		if (this.Skills != null && !"".equals(this.Skills)) {
			String[] vs = this.Skills.split("\\|");

			for(int i = 0; i < vs.length; ++i) {
				if (vs[i].startsWith(type)) {
					return vs[i].substring(1).split("#");
				}
			}

			return null;
		} else {
			return null;
		}
	}

	public void setSkills(String type, String skill) {
		if (this.Skills != null && !"".equals(this.Skills)) {
			StringBuffer buffer = new StringBuffer();
			String[] vs = this.Skills.split("\\|");

			for(int i = 0; i < vs.length; ++i) {
				if (!vs[i].startsWith(type)) {
					if (buffer.length() != 0) {
						buffer.append("|");
					}

					buffer.append(vs[i]);
				}
			}

			if (skill != null && !"".equals(skill)) {
				if (buffer.length() != 0) {
					buffer.append("|");
				}

				buffer.append(type);
				buffer.append(skill);
			}

			this.Skills = buffer.toString();
		} else {
			if (skill != null && !"".equals(skill)) {
				this.Skills = type + skill;
			}

		}
	}

	public void setSkills(String skills) {
		this.Skills = skills;
	}

	public String getBorn() {
		return this.born;
	}

	public void setBorn(String born) {
		this.born = born;
	}

	public String getTimingGood() {
		return this.TimingGood;
	}

	public void setTimingGood(String timingGood) {
		this.TimingGood = timingGood;
	}
}
